#include <stdio.h>

int main() {
    int N;
    scanf("%d", &N);
    
    int found = 0;

    for (int x = 1; x * x <= N; x++) {
        for (int y = x; y * y + x * x <= N; y++) {
            if (x * x + y * y == N) {
                printf("%d %d\n", x, y);
                found = 1;
            }
        }
    }

    if (!found) {
        printf("No Solution\n");
    }

    return 0;
}
